﻿@using eLoan.Models;
@model Notification

@{
    ViewBag.Title = "Add/Edit Notification";

    var command = ViewBag.Command;
}

<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2>Add/Edit Notification</h2>
        <ol class="breadcrumb">
            <li>
                Administration
            </li>
            <li>
                <a href="@Url.Action("Notifications", "Administration")">Notifications</a>
            </li>
            <li class="active">
                <strong>Add/Edit Notification</strong>
            </li>
        </ol>
    </div>
    <div class="col-lg-2"></div>
</div>

<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-8">
            <div class="ibox float-e-margins">
            @using (Html.BeginForm("Save", "Notification", FormMethod.Post, new { id = "saveForm" }))
            {
                @Html.AntiForgeryToken()
                @Html.ValidationSummary(true)
                
                <div class="ibox-title">
                    <div>@Html.ValidationMessageFor(m => m.NotificationName)</div>
                    <div>@Html.ValidationMessageFor(m => m.Description)</div>
                    <div>@Html.ValidationMessageFor(m => m.Message)</div>
                </div>
                <div class="ibox-content">
                    <fieldset>

                        <table class="table table-bordered table-striped">
                            <tr>
                                <th>
                                    @if (command == "Edit")
                                    { @Html.HiddenFor(m => m.ID) }
                                    @Html.LabelFor(m => m.NotificationName)
                                </th>
                                <td>@Html.TextBoxFor(m => m.NotificationName, new { @class = "single-line scroll-field1" })</td>
                            </tr>
                            <tr>
                                <th>@Html.LabelFor(m => m.Description)</th>
                                <td>@Html.TextBoxFor(m => m.Description, new { @class = "single-line scroll-field1" })</td>
                            </tr>
                            <tr>
                                <th>@Html.LabelFor(m => m.Message)</th>
                                <td>@Html.TextAreaFor(m => m.Message, new { @class = "single-line scroll-field1", @rows = "15", @style = "resize:none" })</td>
                            </tr>
                            <tr>
                                <th>@Html.LabelFor(m => m.IsActive)</th>
                                <td>@Html.CheckBoxFor(m => m.IsActive, new { @checked = "checked" })</td>
                            </tr>
                        </table>

                        <p></p>

                        <button type="submit" id="btnSave" class="btn btn-primary" name="command" value=@command>Save</button>
                        <button type="submit" id="btnCancel" class="btn btn-primary cancel" name="command" value="Cancel">Cancel</button>

                    </fieldset>

                </div>
            }
            </div>

        </div>
    </div>
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}


